********************************************************************************
* Relationship between exposure shares and local characteristics
********************************************************************************
clear
use "$data/fiscal.dta", clear
set more off

local vars feff sh_wap05 sh_college05 sh_selfemp05 sh_manuf05 sh_pgds ///
labinc13 sh_wap13 sh_college13 sh_selfemp13 sh_formal13 sh_manuf13

collapse (mean) `vars' sh_ven2005 IV2005 IV2005_rel13 totpop13, by(area year)
keep if year==2013 | year==2018

* REPLACE FISCAL CONTROLS VARIABLES TO THEIR 2013 LEVEL
foreach var of varlist feff sh_pgds {
gen `var'_ = `var' if year==2013
bys area: egen `var'_t = sum(`var'_)
replace `var' = `var'_t
drop `var'_ `var'_t
}

* SCALE LABOR INCOME
replace labinc13 = labinc13 / 1000000


* RUN REGRESSIONS
local controls05 sh_wap05 sh_college05 sh_selfemp05 sh_manuf05

eststo m1: qui reg sh_ven2005 `controls05' [aw = totpop13] if year==2013
est store m1

local controls13 feff sh_pgds labinc13 sh_wap13 sh_college13 sh_selfemp13 sh_manuf13

eststo m2: qui reg sh_ven2005 `controls13' [aw = totpop13] if year==2013
est store m2

eststo m3: qui reg IV2005_rel13 `controls13' [aw = totpop13] if year==2018
est store m3

esttab m1 m2 m3, drop(_cons) b(3) se r2
